<template>
	<view class="flex px-2 align-center mb-2" @click="open" hover-class="bg-light">
		<image class="rounded" :src="item.cover" style="width: 150rpx;height: 150rpx;"></image>
		<view class="flex flex-column ml-2">
			<text class="font-md text-dark">#{{item.name}}#</text>
			<view class="text-secondary font my-2">{{item.desc}}</view>
			<view class="flex text-secondary font">
				<text class="pr-2">动态:{{item.news_count}}</text>
				<text>今日:{{item.today_count}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			item:Object,
			index:Number
		},
		methods:{
			open(){
				// 路由传值
				uni.navigateTo({
					// 把对象转为字符串
					url:`../../pages/topic-detail/topic-detail?detail=${JSON.stringify(this.item)}`
				})
			}
		}
	}
</script>

<style>
</style>
